/*
 * @Author: sympsel sympsel@outlook.com
 * @Date: 2025-08-01 10:59:39
 * @LastEditors: sympsel sympsel@outlook.com
 * @LastEditTime: 2025-09-08 21:37:45
 * @FilePath: \work25_8_1\include\Date.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#pragma once
#include <iostream> // 添加iostream头文件
using namespace std; // 或者使用 std::

class Date {
   public:
    static int GetMonthDay(int year, int month);
    static int GetYearDay(int year);
    static bool IsLeapYear(int year);
    static void PrintWithWeekday(int year, int month, int day);
    static bool Check(int year, int month, int day);
    Date(int year = 1900, int month = 1, int day = 1);
    Date(const Date& d);
    Date& operator=(const Date& d);
    ~Date();
    Date& operator+=(int day);
    Date operator+(int day);
    Date operator-(int day);
    Date& operator-=(int day);
    Date& operator++();
    Date operator++(int);
    Date operator--(int);
    Date& operator--();
    bool operator>(const Date& d);
    bool operator==(const Date& d);
    bool operator>=(const Date& d);
    bool operator<(const Date& d);
    bool operator<=(const Date& d);
    bool operator!=(const Date& d);
    int operator-(const Date& d);
    
    // 移除成员函数声明
    // void Date::operator<<(ostream& out);
    
    void Print();
    
    // 添加友元函数声明
    friend ostream& operator<<(ostream& out, const Date& d);
    friend istream& operator>>(istream& in, Date& d);

   private:
    int _year;
    int _month;
    int _day;
};